function vs:system/game_ctrol/void_shop/page_button/get_last_notnull_slot_index/start
function vs:system/game_ctrol/void_shop/page_button/previous_page_index_compute with storage vs:system temp.VSPB

execute if score #index temp matches 0.. run function vs:system/game_ctrol/void_shop/slot/read_items/start with storage vs:system temp.VSPB
execute if score #index temp matches ..-1 run function vs:system/game_ctrol/void_shop/page_button/previous_to_last

playsound minecraft:block.note_block.xylophone master @a ~ ~ ~ 0.85 1.0

data remove storage vs:system temp.VSPB
scoreboard players reset #index temp
data remove entity @n[tag=VoidShop.PBInteraction,distance=..1,type=interaction] interaction